
#ifndef	__BOCAT_COMMON_MD5_HPP_2010__
#define	__BOCAT_COMMON_MD5_HPP_2010__

#include <sys/types.h>

#include <openssl/md5.h>

namespace	bocat	{
namespace	common	{


class	MD5
{
public	:
	MD5();

public	:
	void	update( const void * data, u_int32_t data_size );

	const char*	digest();
	const char*	hexdigest();

	void	clear();

	u_int32_t size() const { return 16; }

private	:
	MD5_CTX ctx;

	bool	updating;

	unsigned char   md5[17];
	char   md5_hex[33];
};	//// class MD5


}	////	namespace	common	
}	////	namespace	bocat	


#endif	//	__BOCAT_COMMON_MD5_HPP_2010__

